Canonical representation of a positive integer